import { createRouter, createWebHashHistory } from 'vue-router'

//创建路由数据
const router = createRouter({
  history: createWebHashHistory(),
  // history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/LoginPage.vue')
    },
    {
      path: '/',
      name: 'home',
      component: () => import('@/views/layout/LayoutContainer.vue'),
      redirect: '/home',
      children: [
        {
          path: '/home',
          component: () => import('@/views/layout/Home.vue')
        },
        {
          path: '/admin/list',
          component: () => import('@/views/admin/AdminList.vue')
        },
        {
          path: '/tools/insertData',
          component: () => import("@/views/tools/InsertData.vue")
        }
      ]
    }
  ]
})

//未登录拦截操作

export default router
